<%--
  Created by IntelliJ IDEA.
  User: 李林
  Date: 2020/2/29
  Time: 13:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>ERP后台主页</title>
    <meta name="description" content="ERP后台主页">
    <meta name="keywords" content="ERP后台主页">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/morris/morris.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/treeTable/jquery.treetable.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/treeTable/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/select2/select2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/colorpicker/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/ionslider/ion.rangeSlider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/ionslider/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/bootstrap-slider/slider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
</head>

<body class="hold-transition skin-yellow-light sidebar-mini">

<div class="wrapper">

    <!-- 页面头部 -->
    <jsp:include page="../header.jsp"></jsp:include>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <jsp:include page="../aside.jsp"></jsp:include>
    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <div class="content-wrapper onjsp">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                员工入职界面
                <small>管理员</small>
            </h1>
            <ol class="breadcrumb">
                <%--<li><a href="main.jsp"><i class="fa fa-dashboard"></i> 首页</a></li>--%>
            </ol>
        </section>
        <!-- 正文区域 -->
        <section class="content">

            <div class="col-md-12">
                <div class="box box-info">

                        <div class="box-header with-border">
                            <h2 class="box-title">员工入职</h2>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <br>
                        <form class="form-horizontal" id="myForm">
                            <div class="box-body">
                                <div class="divcenter" style="width: 600px;margin: 0 auto;">
                                <div class="form-group">
                                    <label for="inputUsername" class="col-sm-2 control-label">用户名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inputUsername" name="username" placeholder="用户名">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="inputName" class="col-sm-2 control-label">姓名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inputName" name="name" placeholder="姓名">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="inputPassword" class="col-sm-2 control-label">密码</label>
                                    <div class="col-sm-10">
                                        <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">性别</label>
                                    <div class="col-sm-10">
                                        <div class="radio">
                                            <label><input type="radio" name="gender" value="1" checked >男</label>
                                            <label><input type="radio" name="gender" value="2" >女</label>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="inputEmail" class="col-sm-2 control-label">邮箱</label>
                                    <div class="col-sm-10">
                                        <input type="email" class="form-control" id="inputEmail" name="email" placeholder="邮箱">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="inputPhone" class="col-sm-2 control-label">手机号码</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inputPhone" name="phoneNum" placeholder="手机号码">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="datepicker" class="col-sm-2 control-label">日期</label>
                                    <div class="col-sm-10">
                                        <div class="input-group date">
                                            <div class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </div>
                                            <input type="text" class="form-control pull-right" name="date" id="datepicker">
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label  class="col-sm-2 control-label">权限</label>
                                    <div class="col-sm-10">
                                        <select name="admin" class="form-control">
                                            <option selected value="1">普通员工</option>
                                            <option value="2">销售员</option>
                                            <option value="3">进货员</option>
                                            <option value="4">管理员</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="inputWages" class="col-sm-2 control-label">基本工资</label>
                                    <div class="col-sm-10">
                                        <input type="email" class="form-control" id="inputWages" name="baseSalary" placeholder="基本工资">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">工资级别</label>
                                    <div class="col-sm-10">
                                        <select id="level_sel" name="wagesLevel" class="form-control">

                                        </select>
                                    </div>
                                </div>

                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer text-center">
                                <button type="button" class="btn btn-default " style="width: 82px;" onclick="history.back(-1);">返回</button>
                                <button type="button" class="btn btn-info " onclick="adduser()">入职</button>
                            </div>
                            <!-- /.box-footer -->
                            </div>
                        </form>

                </div>
            </div>
            <!--工具栏/-->
        </section>
        <!-- 正文区域 /-->


    </div>
    <!-- 内容区域 /-->

    <!-- 底部导航 -->
    <jsp:include page="../foot.jsp"></jsp:include>
    <!-- 底部导航 /-->

</div>


<script src="${pageContext.request.contextPath}/pages/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/raphael/raphael-min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/morris/morris.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/knob/jquery.knob.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/daterangepicker/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/daterangepicker/daterangepicker.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/fastclick/fastclick.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/iCheck/icheck.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/adminLTE/js/app.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/treeTable/jquery.treetable.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/select2/select2.full.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/ckeditor/ckeditor.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/input-mask/jquery.inputmask.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/chartjs/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/flot/jquery.flot.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/pages/plugins/baiduTemplate/baiduTemplate.js"></script>
<script>
    $(document).ready(function() {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale: 'zh-CN'
        });
    });


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }


    $(document).ready(function() {
        // 激活导航位置
        setSidebarActive("admin-index");
    });
</script>
</body>
</html>
<script>
    function adduser() {
        // alert($('#myForm').serialize());
        var value = $("#level_sel").val();
        if(value == 0){
            alert("请选择工资级别！")
            return;
        }
        alert(document.location.href="usershow");
        // $.ajax(
        //     {
        //         type: "POST",   //提交的方法
        //         url:"useradd.do", //提交的地址
        //         data:$('#myForm').serialize(),// 序列化表单值
        //         async: false,
        //         error: function(request) {  //失败的话
        //             alert("Connection error");
        //         },
        //         success: function(data) {  //成功
        //             alert(data.message);  //就将返回的数据显示出来
        //             // $.get("usershow",{},function (data) {
        //             //     $(".onjsp").html(data);
        //             // })
        //             window.location.href="usershow";
        //         }
        //     });
    }
    $(document).ready(function () {
        var time = new Date();
        var day = ("0" + time.getDate()).slice(-2);
        var month = ("0" + (time.getMonth() + 1)).slice(-2);
        var today = time.getFullYear() + "-" + (month) + "-" + (day);
        $('#datepicker').val(today);
        findWagesLevel();
    });

    function findWagesLevel() {
        $.get("../wages/wageslevel",{},function (data) {
            var list = data.resultList;
            var levels = list["levels"];
            for (var i = 0 ; i<levels.length ; i++){
                var op = '<option value="'+levels[i].id+'">'+levels[i].level+':'+levels[i].description+'</option>';
                // var option = '<option value="'+levels[i].id+'">'+levels[i].level+':'+levels[i].description+'</option>';
                $("#level_sel").append(op);
            }
            $("#level_sel").removeAttr("onmouseenter");
        })
    }
    $('#datepicker').datepicker({
        autoclose: true,
        format: 'yyyy-mm-dd',
        language: 'zh-CN',
        todayBtn: 'linked'
    });
</script>
